import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_csv('The Martian_reviews2.0.csv')

df['Time'] = pd.to_datetime(df['Time'])

df['Sentiment'] = df['Sentiment'].astype('category')

df.set_index('Time', inplace=True)

daily_counts = df.resample('D').size()
weekly_counts = df.resample('W').size()
monthly_counts = df.resample('ME').size()

start_date = '2015-11-01'
end_date_daily = '2016-03-01'
end_date_weekly = '2016-03-01'
end_date_monthly = '2016-03-01'

fig, axes = plt.subplots(3, 1, figsize=(10, 12))

daily_counts[start_date:end_date_daily].plot(ax=axes[0], title='Daily Review Counts', color='b', marker='o')
axes[0].set_ylabel('Count')

weekly_counts[start_date:end_date_weekly].plot(ax=axes[1], title='Weekly Review Counts', color='g', marker='o')
axes[1].set_ylabel('Count')

monthly_counts[start_date:end_date_monthly].plot(ax=axes[2], title='Monthly Review Counts', color='r', marker='o')
axes[2].set_ylabel('Count')

plt.tight_layout()
plt.show()
